<template>
  <div class="f">
    <div class="k">
      <el-button class="l" @click="turn">返回</el-button>
    </div>
    <div class="m">
      <span class="n">申述阶段</span>
    </div>
    <div class="box">
      <el-row :gutter="20">
        <el-col :span="5" offset="2">
          <el-card class="b">
            <el-radio v-model="reason" label="1" style="font-size: 20px;">出勤率</el-radio>
            <el-radio v-model="reason" label="2">绩效完成情况</el-radio>
            <el-radio v-model="reason" label="3">荣誉</el-radio>
            <el-radio v-model="reason" label="4">重大违纪</el-radio>
          </el-card>
        </el-col>
        <el-col :span="16">
          <el-card class="c">
            <span class="d">原因</span>
            <el-input style="width: 100%; margin-top: 20px;margin-bottom: 20px;" type="textarea" :rows="5" placeholder="请输入内容" v-model="prove"></el-input>
            <span class="d">相关证明材料</span>
            <el-upload
              action="https://jsonplaceholder.typicode.com/posts/"
              :on-preview="handlePreview"
              :on-remove="handleRemove"
              :before-remove="beforeRemove"
              multiple
              :limit="3"
              :on-exceed="handleExceed"
              :file-list="fileList">
              <el-button style="margin-top: 15px;" size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
              </el-upload>
          </el-card>
        </el-col>
      </el-row>
      <div class="o">
        <input type="submit" value="提交申述" class="e" @click="submit" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      prove: '',
     reason: '1',
     fileList: [{name: 'nihao',url: '~@/assets.cat.jpg'}]
    }
  },
  methods: {
    handleRemove(file, fileList) {
        console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
    },
    beforeRemove(file) {
      return this.$confirm(`确定移除 ${ file.name }？`);
    },
    turn() {
      this.$router.push('/csData')
    },
    submit() {
      this.$message({
        type: 'success',
        message: '提交申述成功'
      })
      this.$router.push('/csData')
    }
  }
}
</script>

<style lang="less" scoped>
.box {
  width: 40%;
  height: 60%;
  position: relative;
  left: 50%;
  top: 35%;
  transform: translate(-50%,-50%);
  background-color: aquamarine;
  border-width: 10px;
  border-radius: 20px;
}
.b {
  width: 150px;
  height: 350px;
  background-color: rgb(4, 247, 166);
  margin-top: 20px;
  font-size: 20px;
  size: max();
}
.c {
  margin: 20px;
  height: 70%;
}
.d {
  font-size: 15px;
  margin-bottom: 20px;
  width: 100px;
}
.e {
  width: 100px;
  height: 50px;
  font-size: 20px;
  background-color: mediumturquoise;
  border-color: moccasin;
  border-radius: 20px;
}
.e:hover {
  background-color: moccasin;
  font-size: 22px;
  border-radius: 20px;
}
.f {
  height: 100%;
  width: 100%;
  background-color: #f7f5f5;
}
.k {
  position: relative;
  text-align: right;
}
.l {
  margin-top: 30px;
  margin-right: 50px;
  font-size: 18px;
  color: #8ec5fc;
  background: none;
  border-block-end-width: 5px;
}
.m {
  text-align: center;
}
.n {
  font-size: 55px;
  font-weight: 200;
  width: 100px;
  height: 50px;
  size: 20px;
}
.o {
  margin-top: 10px;
  margin-left: 20px;
  text-align: center;
}
</style>